<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier_html_xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>${aier_title}</title>
<meta content="${aier_keywords}" name="keywords">
<meta content="${aier_description}" name="description">
<link href="${aier_css_url}jc/chosen.css" rel="stylesheet">
<link rel="stylesheet" href="${aier_css_url}jq/jq.css" />
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}/ui.css" />
<link rel="stylesheet" href="${aier_css_url}comm/text.css" />
<link rel="stylesheet" href="${aier_css_url}b.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}comm/fb.css" />

<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/hh/ui.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/block.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/arrayList.js"></script>
<script type="text/javascript" src="${aier_js_url}jc/cj.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/jq.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/cn.js"></script>
<script type="text/javascript" src="${aier_js_url}comm/text.js"></script>
<title>天天育儿</title>
</head>
<style type="text/css">
	.input_opacity{
	    filter:alpha(opacity=0); -moz-opacity:0; opacity: 0;
	}
	.input_hidden{
	    visibility: hidden;
	}
</style>
<script type="text/javascript">
$(document).ready(function(){
    $("#parentinginfo").jqGrid({                
        url:'${aier_url}${aier_urijs}parenting_searchParenting${aier_suffix}',                
        datatype:"json",                
        mtype:'GET',
        height:'230',
        width:'600',              
        colNames:['出生天数','内容','操作','spid'],                
        colModel:[                    
        {name:'days',index:'days',width:60,align:'center'},                    
        {name:'content',index:'content',width:200,align:'center'},                    
        {name:'revoked',index:'revoked',width:80,align:'center', sortable:false},
        {name:'spid',index:'spid',hidden : true},
        ],
        //autowidth:true,
        jsonReader: {
            root:"parentingList",
            page: "page",
            total: "page_count",
            records : "count",
            repeatitems: false
        },
        pager: jQuery("#parentingpage"),
        prmNames : {page:"page",sort: "sort"},
        rowNum: 10,
        //rowList: [10, 20, 30],
        sortname: 'days',
        hidegrid: false,
        sortorder: 'asc',
        viewrecords: true,
        caption: '天天育儿',
        gridComplete:function(){
            var ids=jQuery("#parentinginfo").jqGrid('getDataIDs');
            for(var i=0; i<ids.length; i++){
                var id=ids[i]; 
                var con = jQuery("#parentinginfo").jqGrid('getRowData',id).content;
                if (con.indexOf("<br>")>0) {
                    con = con.split("<br>")[0];
                    if (con.length>25) {
                        con = con.substring(0,25);
                    }
                    con = con + "...";
                } else {
	                if (con.length > 25) {
	                    con = con.substring(0,25)+"...";
	                }
                }
                
                var re = "<a href='javascript:;' class='jqtrow' onclick='showInfo(" + id + ")'>查看</a>"; 
                jQuery("#parentinginfo").jqGrid('setRowData', ids[i], { revoked: re,content:con});
            }
        }
    }).navGrid("#parentingpage", { edit: false, add: false, del: false, search: false });
}); 
</script>
<body style="background-color: #EEF2FB;">
    
    <div style="background-color: #EEF2FB;width: 100%;height: 700px; ">	
		<div id="tabs">
			<ul>
				<li><a href="#tabs-1">天天育儿</a></li>
			</ul>
			<div id="tabs-1" style="height: 500px;">
			    <button id="create" onclick="create()"
                       style="margin-top: 0px;"
                       class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                       role="button" aria-disabled="false">
                       <span class="ui-button-text">新增</span>
                   </button>
				<div class="d_content">
					<!-- 表格 -->
					<div style="margin-left: 0px;margin-top: 0px;">
						<table id="parentinginfo"></table>
						<div id="parentingpage"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	$("#tabs").tabs();
	
    function create() {
        window.location.href = "${aier_url}${aier_uri}/parenting_create${aier_suffix}";
    }
    function showInfo(id) {
        var spid = jQuery("#parentinginfo").jqGrid('getRowData', id).spid;
        window.location.href = "${aier_url}${aier_uri}/parenting_detail${aier_suffix}?spid="+spid;
    }
</script>
</html>